package com.yanqu.road.entity.activity.jiuzhou.rank;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;

import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_c_jiu_zhou_rank",desc = "九州棋局排行榜")
public class JiuZhouRank extends DataObject {

    @FieldTypeAnnotation(desc = "活动id",select = true,update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "赛制类型 1积分赛 2淘汰赛",select = true,update = true)
    private int type;               //类型 1-积分 2-淘汰赛

    @FieldTypeAnnotation(desc = "赛区类型 1精英 2宗师 3王者",select = true,update = true)
    private int zoneType;           //赛区类型 1-精英 2-宗师 3-王者

    @FieldTypeAnnotation(desc = "玩家id",select = true,update = true)
    private long userId;

    @FieldTypeAnnotation(desc = "最后更新时间")
    private long lastUpdateTime;

    @FieldTypeAnnotation(desc = "排行榜值")
    private long value;

    @FieldTypeAnnotation(desc = "排行榜参数")
    private List<Long> param = new ArrayList<>();

    public JiuZhouRank(int activityId, long userId, int type, int zoneType, long lastUpdateTime, long value, List<Long> param) {
        this.activityId = activityId;
        this.userId = userId;
        this.type = type;
        this.zoneType = zoneType;
        this.lastUpdateTime = lastUpdateTime;
        this.value = value;
        this.param = param;
    }

    public JiuZhouRank(int activityId, long userId, long value, List<Long> param, long lastUpdateTime) {
        this.activityId = activityId;
        this.userId = userId;
        this.value = value;
        this.param = param;
        this.lastUpdateTime = lastUpdateTime;
    }

    public JiuZhouRank(){

    }

    public int getActivityId() {
        return activityId;
    }
    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public int getType() {
        return type;
    }
    public void setType(int type) {
        if (this.type != type) {
            this.type = type;
            setOp(DataStatus.Update);
        }
    }

    public int getZoneType() {
        return zoneType;
    }
    public void setZoneType(int zoneType) {
        if (this.zoneType != zoneType) {
            this.zoneType = zoneType;
            setOp(DataStatus.Update);
        }
    }

    public long getUserId() {
        return userId;
    }
    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public long getLastUpdateTime() {
        return lastUpdateTime;
    }
    public void setLastUpdateTime(long lastUpdateTime) {
        if (this.lastUpdateTime != lastUpdateTime) {
            this.lastUpdateTime = lastUpdateTime;
            setOp(DataStatus.Update);
        }
    }

    public long getValue() {
        return value;
    }
    public void setValue(long value) {
        if (this.value != value) {
            this.value = value;
            setOp(DataStatus.Update);
        }
    }

    public void setParam(List<Long> param) {
        if (param == null) {
            return;
        }
        this.param = param;
        setOp(DataStatus.Update);
    }

    public List<Long> getParam() {
        return param;
    }

    public JiuZhouRank clone(){
        JiuZhouRank rank = new JiuZhouRank(activityId, userId, type, zoneType, lastUpdateTime, value, param);

        return rank;
    }


}
